home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 October: Technology Seed / ADC Seed CD - October 1999.toast / FireWire / FireWire_2.0_SDK / Interfaces / GenericDriverFamily.h < prev   
Encoding:
C/C++ Source or Header  |  1999-04-12  |  4.6 KB  |  194 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        GenericDriverFamily.h
  3.  
  4.     Contains:    Definitions and interfaces for Generic Driver family.
  5.  
  6.     Version:    1.0
  7.  
  8.     Written by:    Erik Staats
  9.  
  10.     Copyright:    © 1996, 1998 by Apple Computer, Inc., all rights reserved.
  11.  
  12.     File Ownership:
  13.  
  14.         DRI:                Jay Lloyd
  15.  
  16.         Other Contact:        
  17.  
  18.         Technology:            FireWire
  19.  
  20.     Writers:
  21.  
  22.         (jkl)    Jay Lloyd
  23.  
  24.     Change History (most recent first):
  25.  
  26.        <FW6>      8/6/98    jkl        Include dependencies on other header files.
  27.        <FW5>     1/15/98    jkl        Update defines for new interfaces.
  28.        <FW4>      1/4/98    EA        Remove "implement this" comment for
  29.                                     kGDFServiceIsLoadedUponDiscovery.
  30.        <FW3>    10/22/96    ES        Added driverRefNum to GDFDeviceEventData record.
  31.        <FW2>    10/21/96    ES        Filled in contains field.
  32.        <FW1>    10/21/96    ES        first checked in
  33.  
  34. */
  35.  
  36. #ifndef __GENERICDRIVERFAMILY__
  37. #define __GENERICDRIVERFAMILY__
  38.  
  39. #ifndef __NAMEREGISTRY__
  40. #include <NameRegistry.h>
  41. #endif
  42.  
  43. #ifndef __DRIVERSERVICES__
  44. #include <DriverServices.h>
  45. #endif
  46.  
  47. #ifdef __cplusplus
  48. extern "C" {
  49. #endif
  50.  
  51. #if PRAGMA_IMPORT_SUPPORTED
  52. #pragma import on
  53. #endif
  54.  
  55. #if PRAGMA_ALIGN_SUPPORTED
  56. #pragma options align=mac68k
  57. #endif
  58.  
  59. typedef struct OpaqueGDFDeviceEventRegistrationID*        GDFDeviceEventRegistrationID;
  60. typedef struct OpaqueGDFDeviceID*                        GDFDeviceID;
  61.  
  62. enum
  63. {
  64.     kInvalidGDFDeviceEventRegistrationID    = 0,
  65.     kInvalidGDFDeviceID            = 0
  66. };
  67.  
  68. enum
  69. {
  70.     kInvalidGDFEvent            = 0,
  71.     kGDFDeviceAddedEvent        = 1,
  72.     kGDFDeviceRemovedEvent        = 2
  73. };
  74.  
  75. typedef OSStatus    (GDFExpertEntryPoint) (void);
  76. typedef GDFExpertEntryPoint        *GDFExpertEntryPointPtr;
  77.  
  78. struct GDFDeviceEventDataStruct
  79. {
  80.     RegEntryID                    deviceRegEntryID;                        // Name Registry ID of device.
  81.     DriverRefNum                driverRefNum;                            // Driver ref num for device.
  82.     OSType                        serviceType;                            // Service type for device.
  83.     UInt32                        deviceEvent;                            // Type of event that occured.
  84.     GDFDeviceID                    gdfDeviceID;                            // GDF device ID of device.
  85.     GDFDeviceEventRegistrationID
  86.                                 gdfDeviceEventRegistrationID;            // Registration ID for this event.
  87.     UInt32                        eventHandlerData;                        // Data for use by handler.
  88. };
  89. typedef struct GDFDeviceEventDataStruct
  90.                                 GDFDeviceEventData,
  91.                                 *GDFDeviceEventDataPtr;
  92.  
  93. typedef OSStatus (GDFDeviceEventHandlerProc) (
  94.     GDFDeviceEventDataPtr        pGDFDeviceEventData);
  95. typedef GDFDeviceEventHandlerProc
  96.                                 *GDFDeviceEventHandlerProcPtr;
  97.  
  98.  
  99. ////////////////////////////////////////////////////////////////////////////////
  100. //
  101. // GDF service descriptor defs.
  102. //
  103.  
  104. enum
  105. {
  106.     kGDFServiceDescriptionSignature    = 'gdfs'
  107. };
  108.  
  109. enum
  110. {
  111.     kInitialGDFServiceDescriptor    = 0
  112. };
  113.  
  114. enum
  115. {
  116.     kGDFServiceIsLoadedUponDiscovery    = (1 << 0)                        // Auto-load GDFService when discovered.
  117. };
  118.  
  119. typedef UInt32                    GDFServiceDescVersion;
  120. typedef UInt32                    GDFServiceOSRunTimeOptions;
  121.  
  122. struct GDFServiceTypeStruct
  123. {
  124.     OSType                         gdfServiceName;                            // GDFService name.
  125.     NumVersion                     version;                                // GDFService version number.
  126.     OSType                         reserved;                                // Reserved area.
  127. };
  128. typedef struct GDFServiceTypeStruct
  129.                                 GDFServiceType,
  130.                                 *GDFServiceTypePtr;
  131.  
  132. struct GDFServiceOSRunTimeStruct
  133. {
  134.     GDFServiceOSRunTimeOptions     gdfServiceRuntime;                        // Options for OS runtime.
  135.     Str31                         gdfServiceName;                            // GDFService's name to the OS
  136.     UInt32                         gdfServiceDescReserved[8];                // Reserved area
  137. };
  138. typedef struct GDFServiceOSRunTimeStruct
  139.                                 GDFServiceOSRunTime,
  140.                                 *GDFServiceOSRunTimePtr;
  141.  
  142. struct GDFServiceDescriptionStruct
  143. {
  144.     OSType                         gdfServiceDescSignature;                // Signature field of this structure.
  145.     GDFServiceDescVersion         gdfServiceDescVersion;                    // Version of this data structure.
  146.     GDFServiceType                 gdfServiceType;                            // Type of driver.
  147.     GDFServiceOSRunTime         gdfServiceOSRuntime;                    // OS runtime requirements of GDFService.
  148. };
  149. typedef struct GDFServiceDescriptionStruct
  150.                                 GDFServiceDescription,
  151.                                 *GDFServiceDescriptionPtr;
  152.  
  153.  
  154. ////////////////////////////////////////////////////////////////////////////////
  155. //
  156. // Generic driver family services.
  157. //
  158.  
  159. OSStatus    GDFRegisterDeviceEventHandlerProc (
  160.     OSType                        serviceType,
  161.     UInt32                        numEvents,
  162.     UInt32                        *eventTable,
  163.     GDFDeviceEventHandlerProcPtr
  164.                                 gdfDeviceEventHandler,
  165.     UInt32                        eventHandlerData,
  166.     GDFDeviceEventRegistrationID
  167.                                 *pGDFDeviceEventRegistrationID);
  168.  
  169. OSStatus    GDFUnregisterDeviceEventHandler (
  170.     GDFDeviceEventRegistrationID
  171.                                 gdfDeviceEventRegistrationID);
  172.  
  173. OSStatus    GDFRegisterFSSpecExpert (
  174.     FSSpecPtr                    pExpertFSSpec);
  175.  
  176. OSStatus    GDFRegisterFSSpecResourceExpert (
  177.     FSSpecPtr                    pExpertFSSpec,
  178.     ResType                        expertResType,
  179.     short                        expertResID);
  180.  
  181. #if PRAGMA_ALIGN_SUPPORTED
  182. #pragma options align=reset
  183. #endif
  184.  
  185. #if PRAGMA_IMPORT_SUPPORTED
  186. #pragma import off
  187. #endif
  188.  
  189. #ifdef __cplusplus
  190. }
  191. #endif
  192.  
  193. #endif /* __GENERICDRIVERFAMILY__ */
  194.